#include "factory.h"
#include "product.h"
#include <QtQml/qqml.h>
Factory::~Factory()
{

}

Factory::Factory()
{
    qmlRegisterType<Product>("Product", 1, 0, "Product");
}

ConcreteFactory::~ConcreteFactory()
{
}

ConcreteFactory::ConcreteFactory()
{
}

Product *ConcreteFactory::createProduct(QString type)
{
    if(type == "boy")
        return static_cast<Product *>(new ConcreteProduct1());
    else if(type == "girl")
        return static_cast<Product *>(new ConcreteProduct2());

    return static_cast<Product *>(new ConcreteProduct1());
}
